define("tpaGalleries/galleries/tpaGallery",["lodash","core","utils","tpa","color","experiment","coreUtils","santaProps"],function(a,b,c,d,e,f,g,h){"use strict";var i=c.linkRenderer,j=b.compMixins,k=d.tpaMixins,l={ExternalLink:"WEBSITE",EmailLink:"EMAIL",PageLink:"PAGE",DocumentLink:"DOCUMENT",AnchorLink:"ANCHOR",DynamicPageLink:"DYNAMIC_PAGE_LINK"};function m(a){var b=a.split(",");return e({r:b[0],g:b[1],b:b[2]}).hexString()}function n(b,d,e){var f,g,h={};a.forEach(d,function(i,j){f=c.colorParser.getColorValue(b,e[d[j]]);h[j]=a.includes(f,",")?m(f):f;g=e["alpha-"+d[j]];if(!a.isUndefined(g)){h["alpha"+c.stringUtils.capitalize(j)]=g}});return h}function o(b,c,d){if(b.link){return a.merge({},b,i.renderLink(b.link,c,d),{linkType:l[b.link.type]})}return b}function p(b,c,d){return a.map(b,function(a){return o(a,c,d)})}function q(a,b,c,d){var e=g.urlUtils.joinURL(a,"/galleries/"+(d?"src/":"target/"));var f=e+b+"/"+b+".html";return c(f,["compId","deviceType","locale","viewMode"])}function r(b,c,d,e,g){return{params:{props:a.merge({},b,n(d.THEME_DATA,e,g)),quality:d.globalImageQuality,marketingLandingPage:f.isOpen("sv_marketingLandingPage"),items:p(c,d.linkRenderInfo,d.rootNavigationInfo),mainPageId:d.mainPageId},eventType:"SETTINGS_UPDATED",intent:"addEventListener"}}function s(b){return a.map(b,function(b){return a.omit(b,"quality")})}return{mixins:[j.skinBasedComp,k.tpaUrlBuilder,k.tpaCompApi,j.skinInfo],propTypes:{compProp:h.Types.Component.compProp.isRequired,compData:h.Types.Component.compData.isRequired,linkRenderInfo:h.Types.Link.linkRenderInfo.isRequired,rootNavigationInfo:h.Types.Component.rootNavigationInfo.isRequired,navigateToPage:h.Types.navigateToPage.isRequired,compTheme:h.Types.Component.theme.isRequired,style:h.Types.Component.style.isRequired,structure:h.Types.Component.structure.isRequired,tpaPostMessageAspect:h.Types.SiteAspects.tpaPostMessageAspect.isRequired,santaBase:h.Types.santaBase.isRequired,isDebugMode:h.Types.isDebugMode.isRequired,globalImageQuality:h.Types.globalImageQuality.isRequired,mainPageId:h.Types.mainPageId.isRequired,THEME_DATA:h.Types.Theme.THEME_DATA.isRequired,isPlayingAllowed:h.Types.RenderFlags.isPlayingAllowed.isRequired},messageSent:false,isAlive:false,componentInIframeReady:false,processImageClick:function(b){var d=b.args[0],e=this.props.compData.items[d],f=this.props.compData.id,g=i.renderImageZoomLink(this.props.linkRenderInfo,this.props.rootNavigationInfo,e,f);if(this.props.rootNavigationInfo.pageItemId===e.id){return}var h=i.getLinkUrlFromLinkProps(g);var j=a.defaults({pageItemAdditionalData:g["data-page-item-context"]},c.wixUrlParser.parseUrl(this.props.linkRenderInfo,h));this.props.navigateToPage(j)},getInitialState:function(){this.currStyle=this.props.compTheme;this.lastRenderedStyleData={};return{height:this.props.style.height}},setAppIsAlive:function(){this.isAlive=true;this.askToSendIframeMessage(this.props.compProp,this.props.compData)},setComponentInIframeReady:function(){this.messageSent=false;this.componentInIframeReady=true;this.askToSendIframeMessage(this.props.compProp,this.props.compData)},askToSendIframeMessage:function(a,b,c,d){if(this.debounceIframe&&this.shouldDebounceIframe&&this.shouldDebounceIframe(a,b,c)){this.debounceIframe(a,b,c,d)}else{this.sendIframeMessage(a,b,c,d)}},sendIframeMessage:function(a,b,c,d){var e;if(this.isAlive&&this.componentInIframeReady&&!this.messageSent){var f=this.getOverrideParams?this.getOverrideParams(a):a;var g=this.getStyleData(c,d);e=r(f,b.items,this.props,this.getStyleProps(),g);if(this.patchMessageProps){this.patchMessageProps(e.params.props,c)}this.props.tpaPostMessageAspect.sendPostMessage(this,e);this.lastRenderedStyleData=g;this.messageSent=true}},shouldRenderIframe:function(b){var c=p(b.compData.items,b.linkRenderInfo,b.rootNavigationInfo);var d=s(c);var e=s(this.props.compData.items);var f=this.props.globalImageQuality;var g=!a.isEqual(f,b.globalImageQuality)||a.every(this.props.compData.items,function(b){return!a.isEqual(b.quality,f)&&!(a.isEmpty(b.quality)&&a.isEmpty(f))});var h=!a.isEqual(b.compProp,this.props.compProp)||!a.isEqual(e,d)||g||!a.isEqual(this.getStyleData(b.structure.styleId),this.lastRenderedStyleData);return h},componentWillReceiveProps:function(b){var c=b.compTheme;if(!a.isEqual(this.currStyle,c)){this.currStyle=c;this.messageSent=false}if(this.shouldRenderIframe(b)){this.messageSent=false}if(!a.isEqual(b.style.height,this.props.style.height)){this.setState({height:b.style.height})}this.askToSendIframeMessage(b.compProp,b.compData,b.structure.styleId,b);if(this.isPlayingAllowed!==this.props.isPlayingAllowed){this.isPlayingAllowed=this.props.isPlayingAllowed;this.sendEditModeMessage(this.isPlayingAllowed?"site":"editor")}},sendEditModeMessage:function(a){if(!this.isAlive||!this.componentInIframeReady){return}var b={params:{editMode:a},eventType:"EDIT_MODE_CHANGE",intent:"addEventListener"};this.props.tpaPostMessageAspect.sendPostMessage(this,b)},getSkinProperties:function(){return{"":{style:{height:this.state.height||0,minWidth:10,minHeight:10}},iframe:{style:{height:this.state.height,width:this.props.style.width},className:"tpa-gallery-"+this.getGalleryType(),src:q(this.props.santaBase,this.getGalleryType(),this.buildUrl,this.props.isDebugMode)}}}}});define("tpaGalleries/galleries/masonry",["lodash","tpaGalleries/galleries/tpaGallery"],function(a,b){"use strict";var c={textColor:"#000",descriptionColor:"#000",textBackgroundColor:"#fff",backgroundMouseoverColor:"#000",alphaBackgroundMouseoverColor:.4};return{displayName:"MasonryGallery",mixins:[b],statics:{useSantaTypes:true},getGalleryType:function(){return"Masonry"},getStyleProps:function(){return{textColor:"color1",descriptionColor:"color2",textBackgroundColor:"color3",backgroundMouseoverColor:"color4",textButtonColor:"color5"}},patchMessageProps:function(b,d){var e=this.getStyleData(d);if(!e.version||parseInt(e.version,10)===1){a.assign(b,c)}}}});define("tpaGalleries/galleries/accordion",["tpaGalleries/galleries/tpaGallery"],function(a){"use strict";return{displayName:"AccordionGallery",mixins:[a],statics:{useSantaTypes:true},getGalleryType:function(){return"Accordion"},getStyleProps:function(){return{textColor:"color1",descriptionColor:"color2",textBackgroundColor:"color3",borderColor:"color4"}}}});define("tpaGalleries/galleries/impress",["tpaGalleries/galleries/tpaGallery"],function(a){"use strict";return{displayName:"ImpressGallery",mixins:[a],statics:{useSantaTypes:true},getGalleryType:function(){return"Impress"},getStyleProps:function(){return{bcgColor1:"color1",bcgColor2:"color2",bcgColor3:"color3",bcgColor4:"color4",bcgColor5:"color5",textColor:"color6",descriptionColor:"color7",textBackgroundColor:"color8"}}}});define("tpaGalleries/galleries/freestyle",["tpaGalleries/galleries/tpaGallery"],function(a){"use strict";return{displayName:"FreestyleGallery",mixins:[a],statics:{useSantaTypes:true},getGalleryType:function(){return"Freestyle"},getStyleProps:function(){return{borderColor:"color1"}}}});define("tpaGalleries/galleries/collage",["tpaGalleries/galleries/tpaGallery"],function(a){"use strict";return{displayName:"CollageGallery",mixins:[a],statics:{useSantaTypes:true},getGalleryType:function(){return"Collage"},getStyleProps:function(){return{textColor:"color1",descriptionColor:"color2",backgroundMouseoverColor:"color3"}},getOverrideParams:function(a){if(a.maxImageSize>a.numOfCells){a.maxImageSize=a.numOfCells}if(a.minImageSize>a.maxImageSize){a.minImageSize=a.maxImageSize}else if(a.maxImageSize